package com.project.controller.web;

import com.project.entity.RecruitInfo;
import com.project.entity.User;
import com.project.myBeans.ResponseBean;
import com.project.service.RecruitInfoService;
import com.project.service.UserService;
import com.project.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by hasee on 2017/4/6.
 */

@Controller
@RequestMapping("/enterprise")
public class EnterpriseController extends BaseService {
    @Autowired
    RecruitInfoService recruitInfoService;

    @Autowired
    UserService userService;

    /**
     * author: WheelChen
     * date: 2017-4-25
     * function: 根据用户id查找用户
     * @param id
     * @return {json} user
     */
    @RequestMapping(value = "/searchPersonInfo/{id}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseBean findOneById(@PathVariable("id") Integer id){
        ResponseBean responseBean = new ResponseBean();
        User user = null;
        try {
            user = userService.findOneByUserID(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        responseBean.setData(user);
        return responseBean;
    }

//    /**
//     * author: WheelChen
//     * date: 2017-4-25
//     * function: 根据用户id更新用户信息
//     * @param user
//     * @return
//     */
//    @RequestMapping(value = "/modifyPersonInfo", method = RequestMethod.POST)
//    @ResponseBody
//    public ResponseBean modifyOneById(@RequestBody User user)
//    {
//        try {
//            userService.updateUser(user);
//            responseBean.setMessage("保存成功");
//            responseBean.setSuccess(false);
//        }catch (Exception e){
//            e.printStackTrace();
//            responseBean.setSuccess(false);
//            responseBean.setMessage("保存失败");
//        }
//        return responseBean;
//    }






}
